var express = require('express');
var router = express.Router();
var connection = require('../db/sql.js');
/* GET home page. */
router.get('/', function(req, res, next) {
  res.render('index', { title: 'Express' });
});

// router.get("/api/index_list/data", function(req, res, next) {
//   res.json({
//      "a":1
//   })
// });

router.get("/showadv", function(req, res, next) {
  connection.query('SELECT * from renyuan', function(error, results, fields) {
     if (error) throw error;
	 console.log('The solution is: ', results);
	 res.send(results)
  });
});

module.exports = router;
